import * as actionType from './action-type';

// 初始状态
const initialState = {
	category: [],
	user: undefined
};

const Reducer = (state = initialState, action: any) => {
	switch (action.type) {
		case actionType.SET_CATEGORY:
			return Object.assign({}, state, {
				category: action.category
			});
		case actionType.SET_USER:
			return Object.assign({}, state, {
				user: action.user
			});
		default:
			return state
	}
}


export default Reducer;